3.1.96 \(\int \frac {1}{(b+2 a x+b x^2)^2} \, dx\) [96]

Optimal. Leaf size=72 \[ -\frac {a+b x}{2 \left (a^2-b^2\right ) \left (b+2 a x+b x^2\right )}+\frac {b \tanh ^{-1}\left (\frac {a+b x}{\sqrt {a^2-b^2}}\right )}{2 \left (a^2-b^2\right )^{3/2}} \]

[Out]

1/2*(-b*x-a)/(a^2-b^2)/(b*x^2+2*a*x+b)+1/2*b*arctanh((b*x+a)/(a^2-b^2)^(1/2))/(a^2-b^2)^(3/2)

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {628, 632, 212} \begin {gather*} \frac {b \tanh ^{-1}\left (\frac {a+b x}{\sqrt {a^2-b^2}}\right )}{2 \left (a^2-b^2\right )^{3/2}}-\frac {a+b x}{2 \left (a^2-b^2\right ) \left (2 a x+b x^2+b\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(b + 2*a*x + b*x^2)^(-2),x]

[Out]

-1/2*(a + b*x)/((a^2 - b^2)*(b + 2*a*x + b*x^2)) + (b*ArcTanh[(a + b*x)/Sqrt[a^2 - b^2]])/(2*(a^2 - b^2)^(3/2)
)

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 628

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(b + 2*c*x)*((a + b*x + c*x^2)^(p + 1)/((p + 1
)*(b^2 - 4*a*c))), x] - Dist[2*c*((2*p + 3)/((p + 1)*(b^2 - 4*a*c))), Int[(a + b*x + c*x^2)^(p + 1), x], x] /;
 FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0] && LtQ[p, -1] && NeQ[p, -3/2] && IntegerQ[4*p]

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rubi steps

\begin {align*} \int \frac {1}{\left (b+2 a x+b x^2\right )^2} \, dx &=-\frac {a+b x}{2 \left (a^2-b^2\right ) \left (b+2 a x+b x^2\right )}-\frac {b \int \frac {1}{b+2 a x+b x^2} \, dx}{2 \left (a^2-b^2\right )}\\ &=-\frac {a+b x}{2 \left (a^2-b^2\right ) \left (b+2 a x+b x^2\right )}+\frac {b \text {Subst}\left (\int \frac {1}{4 \left (a^2-b^2\right )-x^2} \, dx,x,2 a+2 b x\right )}{a^2-b^2}\\ &=-\frac {a+b x}{2 \left (a^2-b^2\right ) \left (b+2 a x+b x^2\right )}+\frac {b \tanh ^{-1}\left (\frac {a+b x}{\sqrt {a^2-b^2}}\right )}{2 \left (a^2-b^2\right )^{3/2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 72, normalized size = 1.00 \begin {gather*} \frac {a+b x}{2 \left (-a^2+b^2\right ) \left (b+2 a x+b x^2\right )}+\frac {b \tan ^{-1}\left (\frac {a+b x}{\sqrt {-a^2+b^2}}\right )}{2 \left (-a^2+b^2\right )^{3/2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(b + 2*a*x + b*x^2)^(-2),x]

[Out]

(a + b*x)/(2*(-a^2 + b^2)*(b + 2*a*x + b*x^2)) + (b*ArcTan[(a + b*x)/Sqrt[-a^2 + b^2]])/(2*(-a^2 + b^2)^(3/2))

________________________________________________________________________________________

Maple [A]
time = 0.58, size = 86, normalized size = 1.19

method result size
default \(\frac {2 b x +2 a}{\left (-4 a^{2}+4 b^{2}\right ) \left (b \,x^{2}+2 a x +b \right )}+\frac {2 b \arctan \left (\frac {2 b x +2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{\left (-4 a^{2}+4 b^{2}\right ) \sqrt {-a^{2}+b^{2}}}\) \(86\)
risch \(\frac {-\frac {b x}{4 \left (a^{2}-b^{2}\right )}-\frac {a}{4 \left (a^{2}-b^{2}\right )}}{\frac {1}{2} b \,x^{2}+a x +\frac {1}{2} b}+\frac {b \ln \left (\left (-a^{2} b +b^{3}\right ) x -\left (a^{2}-b^{2}\right )^{\frac {3}{2}}-a^{3}+a \,b^{2}\right )}{4 \left (a^{2}-b^{2}\right )^{\frac {3}{2}}}-\frac {b \ln \left (\left (a^{2} b -b^{3}\right ) x -\left (a^{2}-b^{2}\right )^{\frac {3}{2}}+a^{3}-a \,b^{2}\right )}{4 \left (a^{2}-b^{2}\right )^{\frac {3}{2}}}\) \(150\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(b*x^2+2*a*x+b)^2,x,method=_RETURNVERBOSE)

[Out]

(2*b*x+2*a)/(-4*a^2+4*b^2)/(b*x^2+2*a*x+b)+2*b/(-4*a^2+4*b^2)/(-a^2+b^2)^(1/2)*arctan(1/2*(2*b*x+2*a)/(-a^2+b^
2)^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(b*x^2+2*a*x+b)^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?`
 for more de

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 144 vs. \(2 (64) = 128\).
time = 2.75, size = 317, normalized size = 4.40 \begin {gather*} \left [-\frac {2 \, a^{3} - 2 \, a b^{2} + {\left (b^{2} x^{2} + 2 \, a b x + b^{2}\right )} \sqrt {a^{2} - b^{2}} \log \left (\frac {b^{2} x^{2} + 2 \, a b x + 2 \, a^{2} - b^{2} - 2 \, \sqrt {a^{2} - b^{2}} {\left (b x + a\right )}}{b x^{2} + 2 \, a x + b}\right ) + 2 \, {\left (a^{2} b - b^{3}\right )} x}{4 \, {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5} + {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} x^{2} + 2 \, {\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} x\right )}}, -\frac {a^{3} - a b^{2} - {\left (b^{2} x^{2} + 2 \, a b x + b^{2}\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b x + a\right )}}{a^{2} - b^{2}}\right ) + {\left (a^{2} b - b^{3}\right )} x}{2 \, {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5} + {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} x^{2} + 2 \, {\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} x\right )}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(b*x^2+2*a*x+b)^2,x, algorithm="fricas")

[Out]

[-1/4*(2*a^3 - 2*a*b^2 + (b^2*x^2 + 2*a*b*x + b^2)*sqrt(a^2 - b^2)*log((b^2*x^2 + 2*a*b*x + 2*a^2 - b^2 - 2*sq
rt(a^2 - b^2)*(b*x + a))/(b*x^2 + 2*a*x + b)) + 2*(a^2*b - b^3)*x)/(a^4*b - 2*a^2*b^3 + b^5 + (a^4*b - 2*a^2*b
^3 + b^5)*x^2 + 2*(a^5 - 2*a^3*b^2 + a*b^4)*x), -1/2*(a^3 - a*b^2 - (b^2*x^2 + 2*a*b*x + b^2)*sqrt(-a^2 + b^2)
*arctan(-sqrt(-a^2 + b^2)*(b*x + a)/(a^2 - b^2)) + (a^2*b - b^3)*x)/(a^4*b - 2*a^2*b^3 + b^5 + (a^4*b - 2*a^2*
b^3 + b^5)*x^2 + 2*(a^5 - 2*a^3*b^2 + a*b^4)*x)]

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 230 vs. \(2 (58) = 116\).
time = 0.30, size = 230, normalized size = 3.19 \begin {gather*} - \frac {b \sqrt {\frac {1}{\left (a - b\right )^{3} \left (a + b\right )^{3}}} \log {\left (x + \frac {- a^{4} b \sqrt {\frac {1}{\left (a - b\right )^{3} \left (a + b\right )^{3}}} + 2 a^{2} b^{3} \sqrt {\frac {1}{\left (a - b\right )^{3} \left (a + b\right )^{3}}} + a b - b^{5} \sqrt {\frac {1}{\left (a - b\right )^{3} \left (a + b\right )^{3}}}}{b^{2}} \right )}}{4} + \frac {b \sqrt {\frac {1}{\left (a - b\right )^{3} \left (a + b\right )^{3}}} \log {\left (x + \frac {a^{4} b \sqrt {\frac {1}{\left (a - b\right )^{3} \left (a + b\right )^{3}}} - 2 a^{2} b^{3} \sqrt {\frac {1}{\left (a - b\right )^{3} \left (a + b\right )^{3}}} + a b + b^{5} \sqrt {\frac {1}{\left (a - b\right )^{3} \left (a + b\right )^{3}}}}{b^{2}} \right )}}{4} + \frac {- a - b x}{2 a^{2} b - 2 b^{3} + x^{2} \cdot \left (2 a^{2} b - 2 b^{3}\right ) + x \left (4 a^{3} - 4 a b^{2}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(b*x**2+2*a*x+b)**2,x)

[Out]

-b*sqrt(1/((a - b)**3*(a + b)**3))*log(x + (-a**4*b*sqrt(1/((a - b)**3*(a + b)**3)) + 2*a**2*b**3*sqrt(1/((a -
 b)**3*(a + b)**3)) + a*b - b**5*sqrt(1/((a - b)**3*(a + b)**3)))/b**2)/4 + b*sqrt(1/((a - b)**3*(a + b)**3))*
log(x + (a**4*b*sqrt(1/((a - b)**3*(a + b)**3)) - 2*a**2*b**3*sqrt(1/((a - b)**3*(a + b)**3)) + a*b + b**5*sqr
t(1/((a - b)**3*(a + b)**3)))/b**2)/4 + (-a - b*x)/(2*a**2*b - 2*b**3 + x**2*(2*a**2*b - 2*b**3) + x*(4*a**3 -
 4*a*b**2))

________________________________________________________________________________________

Giac [A]
time = 0.71, size = 75, normalized size = 1.04 \begin {gather*} -\frac {b \arctan \left (\frac {b x + a}{\sqrt {-a^{2} + b^{2}}}\right )}{2 \, {\left (a^{2} - b^{2}\right )} \sqrt {-a^{2} + b^{2}}} - \frac {b x + a}{2 \, {\left (b x^{2} + 2 \, a x + b\right )} {\left (a^{2} - b^{2}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(b*x^2+2*a*x+b)^2,x, algorithm="giac")

[Out]

-1/2*b*arctan((b*x + a)/sqrt(-a^2 + b^2))/((a^2 - b^2)*sqrt(-a^2 + b^2)) - 1/2*(b*x + a)/((b*x^2 + 2*a*x + b)*
(a^2 - b^2))

________________________________________________________________________________________

Mupad [B]
time = 0.32, size = 107, normalized size = 1.49 \begin {gather*} -\frac {\frac {a}{2\,\left (a^2-b^2\right )}+\frac {b\,x}{2\,\left (a^2-b^2\right )}}{b\,x^2+2\,a\,x+b}+\frac {b\,\mathrm {atan}\left (\frac {-a^3\,1{}\mathrm {i}-1{}\mathrm {i}\,x\,a^2\,b+a\,b^2\,1{}\mathrm {i}+1{}\mathrm {i}\,x\,b^3}{{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}}\right )\,1{}\mathrm {i}}{2\,{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(b + 2*a*x + b*x^2)^2,x)

[Out]

(b*atan((a*b^2*1i + b^3*x*1i - a^3*1i - a^2*b*x*1i)/((a + b)^(3/2)*(a - b)^(3/2)))*1i)/(2*(a + b)^(3/2)*(a - b
)^(3/2)) - (a/(2*(a^2 - b^2)) + (b*x)/(2*(a^2 - b^2)))/(b + 2*a*x + b*x^2)

________________________________________________________________________________________